package com.hxzy.controller.admin.mapstruct;

import com.hxzy.controller.admin.employee.req.EmployeeAddReq;
import com.hxzy.controller.admin.employee.req.EmployeeEditReq;
import com.hxzy.controller.admin.employee.resp.EmployeeResp;
import com.hxzy.entity.Employee;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Desc mapstruct转换器(Employee)
 * @Author: admin
 * @Date: 2023/06/30/15:42
 */
@Mapper
public interface EmployeeConvert {

    EmployeeConvert  INSTANCE= Mappers.getMapper(EmployeeConvert.class);

    /**
     * 把List<Employee>自动转换为List<EmployeeResp>
     *     注意Employee变量名 一定要与 EmployeeResp变量名一致
     * @param list
     * @return
     */
    List<EmployeeResp> convert(List<Employee> list);


    Employee convert(EmployeeAddReq req);

    EmployeeResp convert(Employee entity);

    Employee convert(EmployeeEditReq req);
}
